package com.naodong.shenluntiku.app;


import android.content.Context;
import android.support.multidex.MultiDex;

import com.apkfuns.logutils.LogUtils;
import com.naodong.shenluntiku.intergation.alipush.PushManager;
import com.naodong.shenluntiku.intergation.jobqueue.BackgroundManage;

import me.shingohu.man.base.BaseApplication;

/**
 * Created by hujie on 17/4/14.
 */

public class BootstrapApplication extends BaseApplication {


    @Override
    public void onCreate() {
        long startTime = System.currentTimeMillis();
        super.onCreate();
        initCloudChannel(this);
        initBackgroundManage(this);
        long endTime = System.currentTimeMillis();
        LogUtils.e("启动时间" + (startTime - endTime) + "毫秒");

    }


    /**
     * 初始化云推送通道
     *
     * @param applicationContext
     */
    private void initCloudChannel(Context applicationContext) {
        PushManager.getInstance().initPush(applicationContext);
    }

    /**
     * 初始化后台管理
     */
    private void initBackgroundManage(Context applicationContext) {
        BackgroundManage.getInstance().initJobManager(applicationContext);
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(base);
    }
}
